/** @jsxImportSource @emotion/react */
import * as React from "react";
import {
  CCell, Cell, Table, TableBody, TableRow, Text,
} from "customize-easy-ui-component";
import {useThreeColumnView} from "../../hook/useThreeColumnSubr";
import {configSetter} from "./Regular.O-1";
import {RepLink} from "../../common/base";
import {TailMenRowIspCheck} from "../../contain/rarelyVary";

export const 资料审查报告= ({theme, orc, rep} :{theme: any, orc:any, rep:any}
) => {
  const newconfig概况 = React.useMemo(() => {
      return configSetter(rep?.modelversion,orc);
  }, [rep?.modelversion,orc]);
  const [renderUpper,_S]=useThreeColumnView({orc, config:newconfig概况,slash:true,});
  //const renderUpper=usePrefixDataReviewTbl({config: config资料审查, orc, rep, slash:true});
  return <>
    <div css={{"@media print": {paddingBottom: '3.5rem', pageBreakInside: 'avoid'}} }>
      <Text id='MaterialReview' variant="h2" css={{
        textAlign: 'center', marginTop: '1rem',
      }}>资料审查</Text>
      <div css={{
        display: 'flex',
        justifyContent: 'space-between'
      }}>
        <Text></Text>
        <Text>报告编号：{rep.isp.no}</Text>
      </div>
    </div>
    <Table  fixed={ ["16.1%","23%","12.5%","19%","12.3%","%"] }  tight  miniw={800}
            css={ {borderCollapse: 'collapse', "@media print": {marginTop: '-3.5rem'}} } >
      <TableBody>
        <RepLink rep={rep} tag={'MaterialReview'}>
          {renderUpper}
        </RepLink>
      </TableBody>
    </Table>
    <Table  fixed={ ["16.1%", "%"] } css={ {borderCollapse: 'collapse' } } tight  miniw={800}>
      <TableBody>
        <RepLink rep={rep} tag={'FactoryMaterial'}>
          <TableRow>
            <CCell>资料审查情况</CCell>
            <Cell split={true}><div css={{minHeight: '3rem', whiteSpace: 'pre-wrap'}}>
              {orc.审查结论 || '／'}
            </div></Cell>
          </TableRow>
          <TableRow>
            <CCell>上次定期检验问题记载</CCell>
            <Cell split={true}><div css={{minHeight: '2rem', whiteSpace: 'pre-wrap'}}>
              {orc.上问题记 || '／'}
            </div></Cell>
          </TableRow>
        </RepLink>
      </TableBody>
    </Table>
    <TailMenRowIspCheck orc={orc} rep={rep} />
  </>;
};
